﻿using ContactCenter.Persistence.NH.Tasks;
using NHibernate.Cfg;
using NHibernate.Event;

namespace ContactCenter.EncryptionEventListener
{
    public class EncryptionListenerTask : TaskBase
    {
        public override Configuration Configure(Configuration configuration)
        {
            var encryptionListener = new EncryptionListener();
            
            configuration.SetListener(ListenerType.PostLoad, encryptionListener);
            configuration.SetListener(ListenerType.PreInsert, encryptionListener);
            configuration.SetListener(ListenerType.PreUpdate, encryptionListener);

            return configuration;
        }

        public override int Position
        {
            get { return 169; }
        }
    }
}
